package com.nycreativity.elecreativity.entity.vo.order

import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableName
import com.nycreativity.elecreativity.entity.enums.OrderStatusEnum
import com.nycreativity.elecreativity.entity.vo.BaseVOParam
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import java.math.BigDecimal
import java.time.LocalDateTime
import javax.validation.constraints.NotBlank


@ApiModel("订单列表查询item")
@TableName("`order`")
data class OrderOverviewVO(
    /**
     * 订单id(订单编号)
     */
    @ApiModelProperty("订单id(订单编号)")
    var id: Long? = null,

    /**
     * 订单创建时间创建时间
     */
    @ApiModelProperty(value = "订单创建时间")
    override var createTime: LocalDateTime? = null,

    /**
     * 订单状态，0：待付款，1：待签收，2：已签收
     */
    @ApiModelProperty(value = "0：待付款，1：待签收，2：已签收")
    var status: Int? = null,

    /**
     * 支付内部id
     */
    @ApiModelProperty("支付内部id")
    var paymentInnerId: String? = null,

    /**
     * 订单支付方式
     */
    var paymentMethod: Int? = null,

    /**
     * 快递单号
     */
    @ApiModelProperty(value = "快递单号")
    var expressNum: String? = null,

    /**
     * 订单总金额
     */
    @ApiModelProperty(value = "订单总金额")
    var totalAmount: BigDecimal = BigDecimal(0)

) : BaseVOParam() {

    /**
     * 订单状态描述
     */
    @Suppress("SuspiciousVarProperty")
    @ApiModelProperty(value = "订单状态描述")
    @TableField(exist = false)
    var statusDes: String? = null
        get() = status?.let { OrderStatusEnum.getStatusDes(it)?.des }
}
